<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>安卓自动兼容测试系统</title>
<script src="/Terminator/js/jquery-3.0.0.min.js">
	
</script>
<link href="/Terminator/css/Share.css" rel="stylesheet" type="text/css">
<link href="/Terminator/css/testCase.css" rel="stylesheet"
	type="text/css">
<script type="text/javascript" src="/Terminator/js/pushcontrol.js">
	
</script>
<script type="text/javascript" src="/Terminator/js/popup.js">
	
</script>
<script src="/Terminator/js/angular.min.js"></script>
<script src="/Terminator/js/ZeroClipboard.min.js"></script>
<script src="/Terminator/js/ngClip.js"></script>
<script src="/Terminator/js/bootstrap.min.js" type="text/javascript"></script>
<link href="/Terminator/css/bootstrap.min.css" rel="stylesheet" />

<script src="/Terminator/js/angular-animate.min.js">
	
</script>
<script src="/Terminator/js/toaster.min.js">
	
</script>

<link href="/Terminator/css/toaster.min.css" rel="stylesheet" />
</head>
<body ng-app='pushCtrlApp' ng-controller='pushCtrlCtrl'>
	<div align="center">
		<toaster-container></toaster-container>
	</div>
	<div id="selectResult"
		style="height: 100%; width: 100%; overflow-x: visible; overflow-y: visible;">
		<div class=" rowcol-md-12 panel panel-primary " style="height: 100%">
			<!--搜索工具栏开始-->
			<div class="input-group col-md-4 pull-right testCaseSelectMain"
				style="width: 100%; height: 15%">
				<div style="width: 23%; height: 100%; float: left;">
					<div class="testCaseSelect">
						<span class="selectDiv" style="line-height: 30px;">学校：</span>
						<div class="selectDiv">
							<select ng-model="sort" class='form-control selectInput'
								ng-options="x for x in sorts" ng-change='sortChange("select")'
								style="float: left;">
							</select>
						</div>
					</div>
					<div class="testCaseSelect">
						<span class="selectDiv" style="line-height: 30px;">位置：</span>
						<div class="selectDiv">
							<select ng-model="func" class='form-control selectInput'
								style="float: left;" ng-change='functionChange()'
								ng-options="x.position for x in re_sort_func">
							</select>
						</div>
					</div>
				</div>
				<div style="width: 27%; float: left; height: 100%;">
					<!-- 频道状态（0：空闲； 1：直播； 2：禁用； 3：直播录制） -->
					<div class="testCaseSelect">
						<div class="isPublicClass" style="width: 25%;">
							<span class="isPublicText" style="line-height: 30px;">空闲</span><input
								type="checkbox" ng-model='isExamine'
								ng-click='examine(0,isExamine)' style="margin: 0;">
						</div>
						<div class="isPublicClass" style="width: 25%;">
							<span class="isPublicText" style="line-height: 30px;">直播</span><input
								type="checkbox" ng-model='isExamine'
								ng-click='examine(1,isExamine)' style="margin: 0;">
						</div>
						<div class="isPublicClass" style="width: 25%;">
							<span class="isPublicText" style="line-height: 30px;">禁用</span><input
								type="checkbox" ng-model='waitExamine' style="margin: 0;"
								ng-click='examine(2,waitExamine)'>
						</div>
						<div class="isPublicClass" style="width: 25%;">
							<span class="isPublicText" style="line-height: 30px;">其它</span><input
								type="checkbox" ng-model='isExamine'
								ng-click='examine(3,isExamine)' style="margin: 0;">
						</div>
					</div>
					<div class="testCaseSelect">
						<div class="isPublicClass" style="width: 30%;">
							<span style="line-height: 30px;" class="isPublicText">全部状态</span><input
								type="radio" name="caseAscr" value="all" ng-model="caseAscr"
								style="margin: 0;" ng-click='radioClick($event)' />
						</div>
						<div class="isPublicClass" style="width: 30%;">
							<span style="line-height: 30px;" class="isPublicText">正常</span><input
								type="radio" name="caseAscr" value="public" ng-model="caseAscr"
								style="margin: 0;" ng-click='radioClick($event)' />
						</div>
						<div class="isPublicClass" style="width: 30%;">
							<span style="line-height: 30px;" class="isPublicText">禁用</span><input
								type="radio" name="caseAscr" value="person" ng-model="caseAscr"
								style="margin: 0;" ng-click='radioClick($event)' />
						</div>
					</div>
				</div>
				<div style="width: 20%; float: left; height: 100%;">
					<div class="testCaseSelect" style="float: left; width: 100%;">
						<input type="text" placeholder="请输入要搜索的设备MAC，模糊查询"
							class="form-control selectText" ng-model="selectFunction"
							maxlength="20" size="20" style="height: 100%; width: 100%;" />
					</div>
					<div class="testCaseSelect" style="float: left; width: 100%;">
						<input type="text" placeholder="请输入要搜索的关键字，模糊查询"
							class="form-control selectText" ng-model="selectKeyword"
							maxlength="20" size="20" style="height: 100%; width: 100%;" />
					</div>
				</div>
				<div style="width: 30%; float: left; height: 100%;">
					<div class=" testCaseSelect testCaseBtn"></div>
					<div class=" testCaseSelect testCaseBtn">
						<button type="button" class="btn btn-info" ng-click='selectCase()'>查询</button>
						<button type="button" class="btn btn-info btn_add"
							ng-click="addTestCase()">新增</button>
						<button type="button" class="btn btn-info"
							ng-click="tongbu()">同步状态</button>
						<button type="button" class="btn btn-info"
							style="margin-left: 2px;" ng-click='deleteCase()'>删除</button>
					</div>
				</div>
			</div>
			<!--搜索工具栏结束-->
			<!--绑定表格开始-->
			<div
				style="width: 100%; height: 85%; overflow: scroll; overflow-x: hidden;">
				<table id="tb" border="1" cellspacing="0"
					style="table-layout: fixed; width: 100%"
					class="table table-striped table-bordered table-hover table-responsive">
					<tr>
						<th style="width: 4%">选择</th>
						<th style="width: 8%">学校</th>
						<th style="width: 8%">安装位置</th>
						<th style="width: 10%">ip地址</th>
						<th style="width: 10%">设备mac编号</th>
						<th style="width: 15%">推流地址</th>
						<th style="width: 15%">拉流地址</th>
						<th style="width: 8%">创建时间</th>
						<th style="width: 4%">状态</th>
						<th style="width: 8%">设置状态</th>
						<th style="width: 4%">备注</th>
						<th style="width: 10%">操作</th>
						<!--<th>编辑</th>  
                                <th>删除</th>-->
					</tr>
					<!--重复项开始，设置排序字段，数据源，names代表数据源，x表示names中遍历的每一个对象，id表示模糊搜索输入的内容，要与输入的input的ng-model一致，col表示排序名称，要与表头中一致-->
					<tr ng-repeat="x in testCases | filter: selectKeyword ">
						<td><input type="checkbox" name="cbx"
							value="{{x.positionid}}" ng-model='selectAll'
							ng-click="isSelected(x,selectAll)" ng-checked="selectAll"
							ng-show='isShowSelect(x.ispublic)' /></td>
						<td
							style="overflow: hidden; white-space: nowrap; text-shadow: gray;">{{x.schoolname}}</td>
						<td
							style="overflow: hidden; white-space: nowrap; text-shadow: gray;">{{x.position}}</td>
						<td
							style="overflow: hidden; white-space: nowrap; text-shadow: gray;">{{x.ip}}</td>
						<td ng-click="show(x.macinfo)"
							style="overflow: hidden; white-space: nowrap; text-shadow: gray;">{{x.macinfo}}</td>
						<td ng-click="show(x.pushurl)"
							style="overflow: hidden; white-space: nowrap; text-shadow: gray;">{{x.pushurl}}</td>
						<td ng-click="show(x.pullurl)"
							style="overflow: hidden; white-space: nowrap; text-shadow: gray;">{{x.pullurl}}</td>
						<td
							style="overflow: hidden; white-space: nowrap; text-shadow: gray;">{{x.pushtime}}</td>
						<td
							style="overflow: hidden; white-space: nowrap; text-shadow: gray;">{{x.state}}</td>
						<td
							style="overflow: hidden; white-space: nowrap; text-shadow: gray;">{{x.setstate}}</td>
						<td ng-click="show(x.markinfo)"
							style="overflow: hidden; white-space: nowrap; text-shadow: gray;">{{x.markinfo}}</td>
						<td
							style="overflow: hidden; white-space: nowrap; text-shadow: gray;">
							<button class="btn-mine"
								ng-click="askExamine(x,isExamineBtn(x.setstate))">{{isExamineBtn(x.setstate)}}</button>
							<button ng-click="editTestCase(x)">编辑</button>
						</td>
					</tr>

				</table>
				<div class="row-fluid" ng-show="isShowPage">
					<div class="span6" style="width: 48.717948717948715%;">
						<div class="dataTables_info" id="sample_1_info">显示{{start}}
							到{{end}}&nbsp;&nbsp;&nbsp;&nbsp; 共查询到{{resultAllLength}}条数据</div>
					</div>
					<div class="span6"
						style="width: 48.717948717948715%; margin-top: -5px;">
						<div class="dataTables_paginate paging_bootstrap pagination"
							style="margin: 0; float: right;">
							<ul>
								<li class="prev " ng-class="{'disabled':p_current==1}"><a
									ng-click="load_page(page-1)" href="javascript:void(0);">← <span
										class="hidden-480">上一页</span>
								</a></li>
								<%-- <li ng-if="p_current >= 5 && pageCount !== 5"><a
									href="javascript:void(0)">...</a></li>
								<li ng-repeat="page in pages"
									ng-class="{'active':p_current==page}"><a
									href="javascript:void(0);" ng-click="load_page(page)">{{page}}</a></li>
								<li ng-if="pageCount > 5 && 1 <= pageCount - 5"><a
									href="javascript:void(0)">...</a></li> --%>
								<li ng-if="page >= pageNum && lastPage !== pageNum"
									ng-click="load_page(1)" ng-class="{active:item==1}"><a
									href="javascript:void(0)">1</a></li>
								<li ng-if="page >= pageNum && lastPage !== pageNum"><a
									href="javascript:void(0)">...</a></li>
								<li ng-class="{active:item==page}" ng-repeat="item in pages"><a
									href="javascript:void(0)" ng-click="load_page(item)">{{item}}</a></li>
								<li
									ng-if="pageCount > pageNum && firstPage <= pageCount - pageNum">
									<a href="javascript:void(0)">...</a>
								</li>
								<li
									ng-if="pageCount > pageNum && firstPage <= pageCount - pageNum"
									ng-click="load_page(pageCount)" ng-class="{active:item==page}"><a
									href="javascript:void(0)">{{pageCount}}</a></li>
								<li class="next" ng-class="{'disabled':p_current==pageCount}"><a
									href="javascript:void(0);" ng-click="load_page(page+1)"><span
										class="hidden-480">下一页</span> → </a></li>
							</ul>
						</div>
					</div>
				</div>
			</div>
			<!--绑定表格结束-->
			<popup ng-show="isShow">
			<div class="mod-popup-example">{{showText}}</div>
			</popup>
		</div>
	</div>

	<div class="overlay" id="spm" style="display: none;"></div>
	<!-- 编辑用例弹出框 -->
	<div class="oneKeyTestCase" style="display: none">
		<!-- 隐藏div -->
		<div class="Popup_top">
			<input type="button" value="关闭" id="copy_btn" class="ClosePopu"
				align="middle" style="float: left;" ng-click='oneKeyTestCaseClose()' />
			<input type="button" value="复制" class="ClosePopu" align="middle"
				style="float: left;" ng-click='copyTestCase()' />
		</div>
		<div class="Popup_cen">
			<textarea class='copyText' style="width: 700px; height: 400px"
				ng-model='testCaseMsg'></textarea>
		</div>
	</div>
	<!-- 编辑用例弹出框 -->
	<div class="PopupEdit" style="display: none">
		<!-- 隐藏div -->
		<div class="Popup_top">
			<input type="button" value="关闭" class="ClosePopu" align="middle"
				style="float: left;" ng-click='pupuEditClose()' /> <input
				type="button" value="提交" class="ClosePopu" align="middle"
				style="float: left;" ng-click='EditCase()' />
		</div>
		<div class="Popup_cen">
			<table width="100%" border="0" cellspacing="0" cellpadding="0"
				class="BD_tab">
				<tr>
					<td style="width: 110px;" align="right">学校名:</td>
					<td><input type="text" ng-model='sortEdit'> <font
						color="red">*</font></td>
				</tr>
				<tr>
					<td style="width: 110px;" align="right">安装位置:</td>
					<td><input type="text" ng-model='funcEdit'> <font
						color="red">*</font></td>
				</tr>
				<tr>
					<td style="width: 110px;" align="right">ip地址:</td>
					<td><input type="text" ng-model='funchildnameEdit'> <font
						color="red">*</font></td>
				</tr>
				<tr>
					<td style="width: 110px;" align="right">设备mac:</td>
					<td><input type="text" ng-model='stepEdit'></input> <font
						color="red">*</font></td>
				</tr>
				<tr>
					<td style="width: 110px;" align="right">预设状态:</td>
					<td><input type="text" id="name" placeholder='正常或者禁用'
						ng-model='expectresultEdit'> <font color="red">*</font></td>
				</tr>
				<tr>
					<td style="width: 110px;" align="right">备注:</td>
					<td><input type="text" ng-model='remarkEdit'></td>
				</tr>
			</table>
		</div>
	</div>
	<!-- 添加用例弹出框 -->
	<div class="Popup" style="display: none">
		<!-- 隐藏div -->
		<div class="Popup_top">
			<input type="button" value="关闭" class="ClosePopu" align="middle"
				style="float: left;" ng-click='pupuClose()' /> <input type="button"
				value="提交" class="ClosePopu" align="middle" style="float: left;"
				ng-click='addCase()' />
		</div>
		<div class="Popup_cen">
			<table width="100%" border="0" cellspacing="0" cellpadding="0"
				class="BD_tab">
				<tr>
					<td style="width: 110px;" align="right">学校名:</td>
					<td><input type="text" ng-model='sortAdd'> <font
						color="red">*</font></td>
				</tr>
				<tr>
					<td style="width: 110px;" align="right">安装位置:</td>
					<td><input type="text" ng-model='funcAdd'><font
						color="red">*</font></td>
				</tr>
				<tr>
					<td style="width: 110px;" align="right">ip地址:</td>
					<td><input type="text" ng-model='funchildname'> <font
						color="red">*</font></td>
				</tr>
				<tr>
					<td style="width: 110px;" align="right">设备MAC:</td>
					<td><input type="text" ng-model='step'></input> <font
						color="red">*</font></td>
				</tr>
				<tr>
					<td style="width: 110px;" align="right">预设状态:</td>
					<td><input type="text" placeholder='正常或者禁用' id="name"
						ng-model='expectresult'> <font color="red">*</font></td>
				</tr>
				<tr>
					<td style="width: 110px;" align="right">备注:</td>
					<td><input type="text" ng-model='remark'></td>
				</tr>
			</table>
		</div>
	</div>
</body>
</html>
